<%@ page language="java" contentType="text/html" pageEncoding="UTF-8"%>
 <%@page errorPage = "errorPage.jsp" %>
 <jsp:useBean id="UserBean" class="user.UserBean" scope="session" />
 	<jsp:setProperty name="UserBean" property="*"/>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Login</title>
	</head>
	<body>
		<%
			session.setMaxInactiveInterval(1800);	// 30 minute timeout
			
			UserBean.login();
			if(UserBean.isLoggedIn())
			{
/* 				out.println("Hello " + UserBean.getFullname() + " at " + UserBean.getLocation() + "<br/>");
				out.println("Admin: " + Boolean.toString(UserBean.isAdmin()) + 
						" InActive: " + Boolean.toString(UserBean.isInactive())); */
				session.setAttribute("user", UserBean);
				
				response.sendRedirect("PictureListController");
			}
			else
			{
				
				out.println("Invalid login<br />");
				out.println("<a href='checkLogin.jsp'>check</A>");
			}
			%>
	</body>
</html>